package com.cooperate.fly.service.buildDB;
import com.cooperate.fly.bo.Case;
import com.cooperate.fly.web.Result;
import javax.servlet.http.HttpSession;
import java.util.List;


/**
 * Created by Stellar_Lee on 2016/4/17.
 */
public interface BuildCaseService {

    Result createCaseNode(Case _case);

    Result deleteCaseNode(Case _case);

    Result deleteCaseNodeById(int id);

    Result updateCaseNode(Case _case);

    Result searchCaseNode(Case _case);

    Result searchCaseNodeById(int id);

    /**
     * 获得数据库所有case列表
     * @return
     */
    List<Case> getAllCases();

    String buildCaseFieldTree(int caseId);

    String getDataBaseCases(int dataBaseId);

    String getCatalogCases(int caseId);

    //visit interface

    String visitCases(String schemaNames);
 //根据实例id以及属性项的id获取属性的值
    String findResult(String caseId,String fieldID);
    String visitCase(String schemaNames, String caseNames);
    //根据实例的id查询所有的二维表及三维表
     String findCaseById(String caseId);
     //访问三维表Z的值
     String findZValue(String caseID,String field,String xValue,String yValue);
     //访问三维表X的值
     String findXValue(String caseID,String field,String xValue);
     //访问三维表Y的值
     String findYValue(String caseID,String field,String yValue);
     //访问三维表x的表头
     String findXTitle(String field);
     
     //访问三维表Y的表头
     String findYTitle(String field);
     //根据实例的id查询所有图片的属性项列表
     String findImageBycaseId(String caseId);
     //根据实例名称查询
     String findInstanceName(String caseId);
    //访问某数据库下的某实例下的某二维表
    String visitMatrix(String schemaNames, String caseNames,String fieldMatrixName);
    //访问二维表的某一列
    String visitOneList(String caseId,String fieldID);
    String visitCaseById(int caseId);
    //访问二维表的某一行
    String visitMatrixById(String caseId,String fieldID,int OrdinalId);
    
    String visitField(String schemaNames, String caseNames, String fieldNames);

    String visitFields(String schemaNames, String caseNames, String fieldNames);

    //load excel to database
    boolean loadExcel(String filename, int caseId);
     //load matrix excel 
   boolean loadMatrixExcel(String filename,int caseId,int fieldId);
   //load threematrix excel
   boolean loadThreeMatrixExcel(String filename,int caseId,int fieldId);
    //create special caseData dir
    void createSpecialDataDir(int caseId);
   
    //create .xls
    void createAndWriteExcel(int caseId);
    //update multi
    void updateMultiValue(int caseId, int fieldId, String value);

    //getImportCasesJson to update case tree
    String getImportTreeJson(int parentId);

    //for cases
    //create special caseData dir
    void createSpecialDataDirForCases(int parentId);

    //create .xls
    void createAndWriteExcelForCases(int parentId);

    //when do with linkData, build case tree, checkbox on caseNode to choose
    String getAllCasesToChoose(String checkIds, HttpSession session);
}
